Open
Conversation
|
Bugbot Autofix prepared a fix for 2 of the 2 bugs found in the latest run.
Or push these changes by commenting: Preview (3559ff7be7)diff --git a/src/utils/dlx.mts b/src/utils/dlx.mts
--- a/src/utils/dlx.mts
+++ b/src/utils/dlx.mts
@@ -25,12 +25,10 @@
import { getDefaultOrgSlug } from '../commands/ci/fetch-default-org-slug.mts'
import constants, {
- CI,
FLAG_QUIET,
FLAG_SILENT,
NPM,
PNPM,
- VITEST,
YARN,
} from '../constants.mts'
import { getErrorCause } from './errors.mts'
@@ -44,6 +42,24 @@
const require = createRequire(import.meta.url)
+/**
+ * Logs spawn output when running in e2e-tests workflow for debugging.
+ */
+function logSpawnOutput(
+ stdout: string | undefined,
+ stderr: string | undefined,
+): void {
+ // Only log when running e2e-tests in CI.
+ if (constants.ENV.CI && constants.ENV.VITEST) {
+ if (stdout) {
+ console.log(stdout)
+ }
+ if (stderr) {
+ console.error(stderr)
+ }
+ }
+}
+
const { PACKAGE_LOCK_JSON, PNPM_LOCK_YAML, YARN_LOCK } = constants
export type DlxOptions = ShadowBinOptions & {
@@ -277,28 +293,12 @@
spawnExtra,
)
const output = await result.spawnPromise
- // Print output when running in e2e-tests workflow for debugging.
- if (CI && VITEST) {
- if (output.stdout) {
- console.log(output.stdout)
- }
- if (output.stderr) {
- console.error(output.stderr)
- }
- }
+ logSpawnOutput(output.stdout, output.stderr)
return { ok: true, data: output.stdout }
} catch (e) {
const stdout = (e as any)?.stdout
const stderr = (e as any)?.stderr
- // Print output when running in e2e-tests workflow for debugging.
- if (CI && VITEST) {
- if (stdout) {
- console.log(stdout)
- }
- if (stderr) {
- console.error(stderr)
- }
- }
+ logSpawnOutput(stdout, stderr)
const cause = getErrorCause(e)
const message = stderr || cause
return { |
Contributor
|
@mtorp Investigation is still on-going in this PR or does it need a merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal is to debug some of the flack reachability and fix-related E2E tests.
Note
Low Risk
Debug-only logging gated behind
CI && VITESTand!silent, with no changes to execution flow or data handling outside test/CI environments.Overview
spawnCoanaDlxnow conditionally prints capturedstdout/stderrafter a dlx run (both on success and in the error path) when running underCI+VITEST, while still respecting the caller’ssilentoption.This adds access to
stdoutfrom thrown errors so CI failures include more diagnostic output without changing normal local behavior.Written by Cursor Bugbot for commit 68e8500. This will update automatically on new commits. Configure here.